//package com.ruoyi.web.controller.business;
//
//
//import cn.dev33.satoken.annotation.SaCheckPermission;
//import cn.hutool.core.util.ObjectUtil;
//import com.ruoyi.common.annotation.Log;
//import com.ruoyi.common.core.controller.BaseController;
//import com.ruoyi.common.core.domain.PageQuery;
//import com.ruoyi.common.core.domain.R;
//import com.ruoyi.common.core.page.TableDataInfo;
//import com.ruoyi.common.core.validate.QueryGroup;
//import com.ruoyi.common.enums.BusinessType;
//import com.ruoyi.common.exception.ServiceException;
//import com.ruoyi.system.domain.bo.SysOssBo;
//import com.ruoyi.system.domain.vo.SysOssVo;
//import com.ruoyi.system.service.ISysOssService;
//import io.swagger.v3.oas.annotations.Operation;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import lombok.RequiredArgsConstructor;
//import org.springframework.http.MediaType;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//import org.springframework.web.multipart.MultipartFile;
//
//import javax.servlet.http.HttpServletResponse;
//import javax.validation.constraints.NotEmpty;
//import java.io.IOException;
//import java.util.Arrays;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
///**
// * 文件上传 控制层
// *
// * @author Lion Li
// */
//@Tag(name = "文件上传")
//@RequiredArgsConstructor
//@RestController
//@RequestMapping("/system/file")
//public class FileController extends BaseController {
//
//    private final ISysOssService iSysOssService;
//
//
//
//
//    /**
//     * 上传OSS对象存储
//     *
//     * @param file 文件
//     */
//    @Operation(summary = "文件上传")
//    @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
//    public R<Map<String, String>> upload(@RequestPart("file") MultipartFile file) {
//        if (ObjectUtil.isNull(file)) {
//            throw new ServiceException("上传文件不能为空");
//        }
//        SysOssVo oss = iSysOssService.upload(file);
//        Map<String, String> map = new HashMap<>(2);
//        map.put("url", oss.getUrl());
//        map.put("fileName", oss.getOriginalName());
//        map.put("ossId", oss.getOssId().toString());
//        return R.ok(map);
//    }
//
//
//
//}
